# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaRemoveSuggestionRequest do
  @moduledoc """
  Request message for CompletionService.RemoveSuggestion method.

  ## Attributes

  *   `removeAllSearchHistorySuggestions` (*type:* `boolean()`, *default:* `nil`) - Remove all search history suggestions for the user.
  *   `removeTime` (*type:* `DateTime.t`, *default:* `nil`) - Required. Time at which the suggestion was removed. If not set, the current time will be used.
  *   `searchHistorySuggestion` (*type:* `String.t`, *default:* `nil`) - The search history suggestion to be removed.
  *   `userInfo` (*type:* `GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaUserInfo.t`, *default:* `nil`) - Optional. Information about the end user. This should be the same identifier information as UserEvent.user_info and SearchRequest.user_info.
  *   `userPseudoId` (*type:* `String.t`, *default:* `nil`) - Required. A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website. This field should NOT have a fixed value such as `unknown_visitor`. This should be the same identifier as UserEvent.user_pseudo_id and SearchRequest.user_pseudo_id. The field must be a UTF-8 encoded string with a length limit of 128.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :removeAllSearchHistorySuggestions => boolean() | nil,
          :removeTime => DateTime.t() | nil,
          :searchHistorySuggestion => String.t() | nil,
          :userInfo =>
            GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaUserInfo.t()
            | nil,
          :userPseudoId => String.t() | nil
        }

  field(:removeAllSearchHistorySuggestions)
  field(:removeTime, as: DateTime)
  field(:searchHistorySuggestion)

  field(:userInfo,
    as: GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaUserInfo
  )

  field(:userPseudoId)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaRemoveSuggestionRequest do
  def decode(value, options) do
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaRemoveSuggestionRequest.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.DiscoveryEngine.V1beta.Model.GoogleCloudDiscoveryengineV1betaRemoveSuggestionRequest do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
